package com.itheima.demo3;

/**
 * @program: Myset
 * @description:
 * @author: xuejingjing
 * @create: 2021-06-29 22:19
 **/
public class EnumDemo {
    public static void main(String[] args) {
        //1返回枚举项的名字
        String name = Season.SPRING.name();
        System.out.println(name);


        //2返回索引值
        System.out.println(Season.SPRING.ordinal());

        //
        System.out.println(Season.SPRING.compareTo(Season.WINTER));


    }
}
